Skip to main content

About the Libraries

The JS libraries allow your Epicenter application to make calls to the Epicenter backend using API adapters implemented by the epicenter-libs package (github.com/forio/epicenter-libs).

Learn more

Entity keys

Most entities in the JS libraries have GUID identifiers known as keys. For example, a group has a group key stored in the groupKey property.

Pagination

The adapter methods handle pagination for you when making requests to the Epicenter API. To consume a paginated response, use the first, max, and count properties of a GenericSearchOptions object.

It is recommended to use the adapter methods whenever possible, but you can also make calls to the API using the Router directly. In this case, when making a request to a paginated endpoint, pass a RoutingOptions object with the paginated property set to true.

import { Router } from 'epicenter-libs';

const groups = await new Router()
.get('/group/search', { paginated: true })
.then(({ body }) => body);

The example above is equivalent to a call to the groupAdapter.query() method, which should be used.